import { createFromIconfontCN } from '@ant-design/icons';
export const Iconfont = createFromIconfontCN({
  // 在 iconfont.cn 上生成
  scriptUrl: '//at.alicdn.com/t/font_426015_qudi1wzlel.js',
});

export const getArray = (xAry, yAry) => {
  return xAry.map( (item, index) => [item, yAry[index]]);
};

//获取去到年-月-日
export const getDate = (time) => {
  let date = new Date(time);
  let y = date.getFullYear(),
  m = (date.getMonth() + 1) < 10 ? '0' + (date.getMonth() + 1) : (date.getMonth() + 1),
  d = date.getDate() < 10 ? '0' + date.getDate() : date.getDate();
return y + '-' + m + '-' + d;
}

//获取到星期 英文
export const getWeek = (time) => {
  let date = new Date(time).getDay();
  let day 
  switch(date){
    case 0:
      day = "Sun";
      break;
    case 1:
        day = "Mon";
        break;
    case 2:
        day = "Tue";
        break;
    case 3:
        day = "Wen";
        break;
    case 4:
        day = "Thu";
        break;
    case 5:
        day = "Fri";
        break;
    case 6:
        day = "Sat";
  }
  return day

}
